<template>
	<view class="wrap" style="padding-bottom: 60px;">
		<u-tabs :list="tabList" :is-scroll="false" :current="current" @change="change"></u-tabs>
		<view class="search">
			<u-search v-model="queryParam.orderParams" @custom="search" @search="search"></u-search>
		</view>
		<mescroll-uni ref="mescrollRef" @init="mescrollInit" :top="top" @down="downCallback" @up="loadData">
			<view v-for="(item,index) in list" :key="index">
				<u-card @click="toDetail(item)" class="task-list-item" :border="false" padding="20" margin="20rpx">
					<view slot="head" style="display: flex;align-items: center;justify-content: space-between;">
						<view style="display: flex;align-items: center;font-size: 30rpx;">{{item.saleOrderCode || ''}}</view><view style="color: #999999;font-size: 22rpx;">{{item.saleOrderDate || ''}}</view>
					</view>
					<view class="" slot="body">
						<u-row gutter="16">
							<u-col span="12">
								<view class="apply-text"><span>客户名称：</span>{{ item.customerName || '' }}</view>
								<view class="apply-text"><span>地址：</span>{{item.address || ''}}</view>
								<view class="apply-text"><span>业主电话：</span>{{item.phone || ''}}</view>
								<view class="apply-text"><span>问题描述：</span>{{item.remark || ''}}</view>
								<view class="apply-text"><span>处理跟进：</span>{{item.remarkA || ''}}</view>
								<view  v-if="item.saleOrderAttaches && item.saleOrderAttaches.length">
									<view class="apply-text"><span>客户图片：</span></view>
									<view style="padding: 20rpx;">
										<image class="user-images" :src="img.attachPath.replace(/\\/g,'/')" v-for="(img,idx) in item.saleOrderAttaches" :key="idx" @click.stop="previewImage(img.attachPath.replace(/\\/g,'/'))"></image>
									</view> 
								</view>
								<view  v-if="item.afterSaleOrderAttaches && item.afterSaleOrderAttaches.length">
									<view class="apply-text"><span>处理图片：</span></view>
									<view style="padding: 20rpx;">
										<image class="user-images" :src="img.attachPath.replace(/\\/g,'/')" v-for="(img,idx) in item.afterSaleOrderAttaches" @click.stop="previewImage(img.attachPath)" :key="idx"></image>
									</view>
								</view>
							</u-col>
						</u-row>
					</view>
					<!-- <view class="apply-list-foot" slot="foot" style="text-align: right;color: #58ca93;">
						审批通过
					</view> -->
				</u-card>
			</view>
		</mescroll-uni>
	</view>
	
</template>

<script>
import MescrollMixins from '@/components/mescroll-uni/mescroll-mixins';
import ListMxin from './mixins/ListMxin';
export default {
	mixins:[MescrollMixins,ListMxin],
	data() {
		return {
			tabList: [{
				name: '未处理'
			}, {
				name: '已处理',
			}],
			queryParam: {
				status:1
			},
			current: 0,
			show: false,
			url:{
				list:'afterSaleOrderList'
			}
		}
	},
	methods: {
		change(index) {
			this.current = index;
			this.queryParam.status = index + 1
			this.pageOption.page = 1
			this.list = []
			this.loadData(this.pageOption)
		},
		toDetail(item){
			if(this.current == 0){
				this.navTo('/pages/sys/workbench/afterSalesProcessingDetails',item)
			}
		}
	}
	
}
</script>

<style lang="scss" scoped>
@import 'index.scss';
page {
	background-color: #f5f5f5;
}
.wrap .search{
	background: #ffffff;
}
.apply-text{
	font-size: 28rpx;
	color: #333333;
	span{
		color: #999999;
	}
}
.user-images{
	width: 80px;
	height:80px;
	margin-right: 8px;
}
.apply-list-foot{
	font-size: 28rpx;
}
.personnel-list{
	display: flex;
	align-items: center;
	flex-wrap:wrap;
	.personnel-user{
		position: relative;
		margin: 5px 9px 0;
	}
	.user-images{
		width: 48px;
		height:48px;
		margin-right:0;
		
	}
	.iconfont{
		position: absolute;
		top:-12px;
		right:-5px;
		color: #FE0100;
	}
}
</style>